

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
    <style>
    /* base */
    html,
    body,
    .container {
      width: 100%;
      height: 100%;
    }

    a,
    a:link,
    a:visited {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    *,
    ::before,
    ::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    *:focus {
      outline: 0;
    }

    .container {
      display: flex;
      padding-top: 20px;
    }

    /* Nav */
    .container .doc-nav {
      position: fixed;
      height: 100%;
      margin: 0 30px 0 40px;
      width: 280px;
    }

    .doc-nav .nav-header {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      background-color: rgb(240, 241, 242);
      height: 40px;
      padding: 16px;
      font-size: 18px;
      font-weight: 500;
      color: rgb(62, 64, 66);
      cursor: pointer;
    }

    .doc-nav .nav-content {
      height: calc(100% - 40px);
      overflow-y: auto;
      color: rgb(32, 34, 36);
    }

    .doc-nav .nav-content .nav-list,
    .doc-nav .nav-content .nav-sub-list {
      line-height: 1.5rem;
    }

    .doc-nav .nav-content .nav-label {
      display: inline-block;
      position: relative;
      padding: 2px 0 2px 20px;
      margin-bottom: 4px;
    }

    .doc-nav .nav-content .nav-sub-label {
      position: relative;
      padding: 2px 0 2px 40px;
      font-size: 14px;
    }

    .doc-nav .nav-content .nav-sub-label:hover {
      text-decoration: underline;
    }

    .doc-nav .nav-content .nav-list .nav-label.group::before {
      border-bottom: 0.25rem solid transparent;
      border-left: 0.25rem solid #6e7072;
      border-right: 0;
      border-top: 0.25rem solid transparent;
      content: '';
      display: block;
      height: 0;
      left: 0.5rem;
      position: absolute;
      top: 0.625rem;
      transition: transform 0.1s linear;
      width: 0;
    }

    .doc-nav .nav-content .nav-list .nav-label.group.active::before {
      transform: rotate(90deg);
    }

    /* doc content */
    .container .doc-content {
      position: fixed;
      height: 100%;
      width: calc(100% - 80px - 40px - 30px - 240px);
      right: 0%;
      overflow-y: auto;
    }

    .doc-title {
      border-bottom: 1px solid #dcdee0;
      font-size: 22px;
      margin: 8px 0 0;
      padding-bottom: 16px;
    }

    .doc-content h3 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0;
    }

    .doc-content h4 {
      font-size: 22px;
      font-weight: 500;
      margin: 30px 0 8px;
    }

    .doc-content h4 span {
      color: #007d9c;
    }

    .doc-content .doc-declare {
      background-color: #fafafa;
      border-radius: 5px;
      border: 1px solid #ccc;
      font-size: 14px;
      overflow-x: auto;
      padding: 10px;
      tab-size: 4;
      line-height: 20px;
    }

    .doc-content .doc-comment {
      font-size: 16px;
      margin: 16px 0;
      line-height: 24px;
      word-break: break-word;
    }
  </style>

</head>
<body>
  <div class="container">
    <div class="doc-nav">
      <a href="#Documentation" class="nav-header">Documentation</a>
      <nav class="nav-content">
        <ul class="nav-list">
          <li>
            <a href="#includes" class="nav-label">Includes</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#uni_log.h" class="nav-sub-label">uni_log.h</a>
              </li>
      

              <li>
                <a href="#syslog.h" class="nav-sub-label">syslog.h</a>
              </li>
      

              <li>
                <a href="#pdu.h" class="nav-sub-label">pdu.h</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#macros" class="nav-label">Macros</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#COAP_DEBUG_H_" class="nav-sub-label">COAP_DEBUG_H_</a>
              </li>
      

              <li>
                <a href="#COAP_DEBUG_FD" class="nav-sub-label">COAP_DEBUG_FD</a>
              </li>
      

              <li>
                <a href="#COAP_ERR_FD" class="nav-sub-label">COAP_ERR_FD</a>
              </li>
      

              <li>
                <a href="#coap_log(level, ...)" class="nav-sub-label">coap_log(level, ...)</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#functions" class="nav-label">Functions</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#coap_set_log_level" class="nav-sub-label">coap_set_log_level</a>
              </li>
      

              <li>
                <a href="#coap_set_log_handler" class="nav-sub-label">coap_set_log_handler</a>
              </li>
      

              <li>
                <a href="#coap_log_impl" class="nav-sub-label">coap_log_impl</a>
              </li>
      

              <li>
                <a href="#coap_log_impl" class="nav-sub-label">coap_log_impl</a>
              </li>
      

              <li>
                <a href="#coap_set_show_pdu_output" class="nav-sub-label">coap_set_show_pdu_output</a>
              </li>
      

              <li>
                <a href="#coap_show_pdu" class="nav-sub-label">coap_show_pdu</a>
              </li>
      

              <li>
                <a href="#coap_show_tls_version" class="nav-sub-label">coap_show_tls_version</a>
              </li>
      

              <li>
                <a href="#coap_print_addr" class="nav-sub-label">coap_print_addr</a>
              </li>
      

              <li>
                <a href="#coap_debug_set_packet_loss" class="nav-sub-label">coap_debug_set_packet_loss</a>
              </li>
      

              <li>
                <a href="#coap_debug_send_packet" class="nav-sub-label">coap_debug_send_packet</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#vars" class="nav-label">Vars</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#coap_log_t" class="nav-sub-label">coap_log_t</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#coap_address_t" class="nav-sub-label">coap_address_t</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#consts" class="nav-label">Consts</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="# " class="nav-sub-label"> </a>
              </li>
      

              <li>
                <a href="# " class="nav-sub-label"> </a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#types" class="nav-label">Types</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#typedefs" class="nav-label">Typedefs</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#coap_log_t;" class="nav-sub-label">coap_log_t;</a>
              </li>
      

              <li>
                <a href="#coap_log_handler_t" class="nav-sub-label">coap_log_handler_t</a>
              </li>
      
            </ul>
            
          </li>
        </ul>
      </nav>
    </div>
    <div class="doc-content">
      <h2 id="Documentation" class="doc-title">Documentation</h2>
      <h3 id="includes">Includes</h3>
      

      <h4 id="uni_log.h"><span>uni_log.h</span></h4>
      <pre class="doc-declare"><code>#include "uni_log.h"
</code></pre>
      <pre class="doc-comment">#include "uni_log.h"
</pre>

      <h4 id="syslog.h"><span>syslog.h</span></h4>
      <pre class="doc-declare"><code>#include &lt;syslog.h&gt;
</code></pre>
      <pre class="doc-comment">#include <syslog.h>
</pre>

      <h4 id="pdu.h"><span>pdu.h</span></h4>
      <pre class="doc-declare"><code>#include "pdu.h"
</code></pre>
      <pre class="doc-comment">#include "pdu.h"
</pre>
      <h3 id="macros">Macros</h3>
      

      <h4 id="COAP_DEBUG_H_">Marco <span>COAP_DEBUG_H_</span></h4>
      <pre class="doc-declare"><code>#define COAP_DEBUG_H_
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="COAP_DEBUG_FD">Marco <span>COAP_DEBUG_FD</span></h4>
      <pre class="doc-declare"><code>#define COAP_DEBUG_FD stdout
</code></pre>
      <pre class="doc-comment">/**
 * Used for output for @c LOG_DEBUG to @c LOG_ERR.
 */</pre>

      <h4 id="COAP_ERR_FD">Marco <span>COAP_ERR_FD</span></h4>
      <pre class="doc-declare"><code>#define COAP_ERR_FD stderr
</code></pre>
      <pre class="doc-comment">/**
 * Used for output for @c LOG_CRIT to @c LOG_EMERG.
 */</pre>

      <h4 id="coap_log(level, ...)">Marco <span>coap_log(level, ...)</span></h4>
      <pre class="doc-declare"><code>#define coap_log(level, ...) do { \
 if ((int)((level))<=(int)coap_get_log_level()) \
    PR_DEBUG(__VA_ARGS__);  \
} while(0)
</code></pre>
      <pre class="doc-comment">/**
 * Logging function.
 * Writes the given text to @c COAP_ERR_FD (for @p level <= @c LOG_CRIT) or @c
 * COAP_DEBUG_FD (for @p level >= @c LOG_ERR). The text is output only when
 * @p level is below or equal to the log level that set by coap_set_log_level().
 *
 * @param level One of the LOG_* values.
 */</pre>
      <h3 id="functions">Functions</h3>
      

      <h4 id="coap_set_log_level">Func <span>coap_set_log_level</span></h4>
      <pre class="doc-declare"><code>void coap_set_log_level(coap_log_t level);</code></pre>
      <pre class="doc-comment">/**
 * Sets the log level to the specified value.
 *
 * @param level One of the LOG_* values.
 */</pre>

      <h4 id="coap_set_log_handler">Func <span>coap_set_log_handler</span></h4>
      <pre class="doc-declare"><code>void coap_set_log_handler(coap_log_handler_t handler);</code></pre>
      <pre class="doc-comment">/**
 * Add a custom log callback handler.
 *
 * @param handler The logging handler to use or @p NULL to use default handler.
 */</pre>

      <h4 id="coap_log_impl">Func <span>coap_log_impl</span></h4>
      <pre class="doc-declare"><code>void coap_log_impl(coap_log_t level,
             const char *format, ...) __attribute__ ((format(printf, 2, 3)));</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="coap_log_impl">Func <span>coap_log_impl</span></h4>
      <pre class="doc-declare"><code>void coap_log_impl(coap_log_t level, const char *format, ...);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="coap_set_show_pdu_output">Func <span>coap_set_show_pdu_output</span></h4>
      <pre class="doc-declare"><code>void coap_set_show_pdu_output(int use_fprintf);</code></pre>
      <pre class="doc-comment">/**
 * Defines the output mode for the coap_show_pdu() function.
 *
 * @param use_fprintf @p 1 if the output is to use fprintf() (the default)
 *                    @p 0 if the output is to use coap_log().
 */</pre>

      <h4 id="coap_show_pdu">Func <span>coap_show_pdu</span></h4>
      <pre class="doc-declare"><code>void coap_show_pdu(coap_log_t level, const coap_pdu_t *pdu);</code></pre>
      <pre class="doc-comment">/**
 * Display the contents of the specified @p pdu.
 * Note: The output method of coap_show_pdu() is dependent on the setting of
 * coap_set_show_pdu_output().
 *
 * @param level The required minimum logging level.
 * @param pdu The PDU to decode.
 */</pre>

      <h4 id="coap_show_tls_version">Func <span>coap_show_tls_version</span></h4>
      <pre class="doc-declare"><code>void coap_show_tls_version(coap_log_t level);</code></pre>
      <pre class="doc-comment">/**
 * Display the current (D)TLS library linked with and built for version.
 *
 * @param level The required minimum logging level.
 */</pre>

      <h4 id="coap_print_addr">Func <span>coap_print_addr</span></h4>
      <pre class="doc-declare"><code>size_t coap_print_addr(const struct coap_address_t *address,
                      unsigned char *buffer, size_t size);</code></pre>
      <pre class="doc-comment">/**
 * Print the address into the defined buffer.
 *
 * Internal Function.
 *
 * @param address The address to print.
 * @param buffer The buffer to print into.
 * @param size The size of the buffer to print into.
 *
 * @return The amount written into the buffer.
 */</pre>

      <h4 id="coap_debug_set_packet_loss">Func <span>coap_debug_set_packet_loss</span></h4>
      <pre class="doc-declare"><code>int coap_debug_set_packet_loss(const char *loss_level);</code></pre>
      <pre class="doc-comment">/**
 * Set the packet loss level for testing.  This can be in one of two forms.
 *
 * Percentage : 0% to 100%.  Use the specified probability.
 * 0% is send all packets, 100% is drop all packets.
 *
 * List: A comma separated list of numbers or number ranges that are the
 * packets to drop.
 *
 * @param loss_level The defined loss level (percentage or list).
 *
 * @return @c 1 If loss level set, @c 0 if there is an error.
 */</pre>

      <h4 id="coap_debug_send_packet">Func <span>coap_debug_send_packet</span></h4>
      <pre class="doc-declare"><code>int coap_debug_send_packet(void);</code></pre>
      <pre class="doc-comment">/**
 * Check to see whether a packet should be sent or not.
 *
 * Internal function
 *
 * @return @c 1 if packet is to be sent, @c 0 if packet is to be dropped.
 */</pre>
      <h3 id="vars">Vars</h3>
      

      <h4 id="coap_log_t">Variable <span>coap_log_t</span></h4>
      <pre class="doc-declare"><code>coap_log_t coap_get_log_level(void);</code></pre>
      <pre class="doc-comment">/**
 * Get the current logging level.
 *
 * @return One of the LOG_* values.
 */</pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>char *coap_string_tls_version(char *buffer, size_t bufsize);</code></pre>
      <pre class="doc-comment">/**
 * Build a string containing the current (D)TLS library linked with and
 * built for version.
 *
 * @param buffer The buffer to put the string into.
 * @param bufsize The size of the buffer to put the string into.
 *
 * @return A pointer to the provided buffer.
 */</pre>

      <h4 id="coap_address_t">Variable <span>coap_address_t</span></h4>
      <pre class="doc-declare"><code>struct coap_address_t;</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="consts">Consts</h3>
      

      <h4 id=" ">Const <span> </span></h4>
      <pre class="doc-declare"><code>const char *coap_package_name(void);</code></pre>
      <pre class="doc-comment">/**
 * Get the library package name.
 *
 * @return Zero-terminated string with the name of this library.
 */</pre>

      <h4 id=" ">Const <span> </span></h4>
      <pre class="doc-declare"><code>const char *coap_package_version(void);</code></pre>
      <pre class="doc-comment">/**
 * Get the library package version.
 *
 * @return Zero-terminated string with the library version.
 */</pre>
      <h3 id="types">Types</h3>
      
      <h3 id="typedefs">Typedefs</h3>
      

      <h4 id="coap_log_t;">Typedef <span>coap_log_t;</span></h4>
      <pre class="doc-declare"><code>typedef short coap_log_t;
#else
/** Pre-defined log levels akin to what is used in \b syslog. */
typedef enum {
 LOG_EMERG=0, /**< Emergency */
 LOG_ALERT,  /**< Alert */
 LOG_CRIT,   /**< Critical */
 LOG_ERR,    /**< Error */
 LOG_WARNING, /**< Warning */
 LOG_NOTICE, /**< Notice */
 LOG_INFO,   /**< Information */
 LOG_DEBUG   /**< Debug */
} coap_log_t;</code></pre>
      <pre class="doc-comment">/**
 * Logging type.  One of LOG_* from @b syslog.
 */</pre>

      <h4 id="coap_log_handler_t">Typedef <span>coap_log_handler_t</span></h4>
      <pre class="doc-declare"><code>typedef void (*coap_log_handler_t) (coap_log_t level, const char *message);
</code></pre>
      <pre class="doc-comment">/**
 * Logging call-back handler definition.
 *
 * @param level One of the LOG_* values.
 * @param message Zero-terminated string message to log.
 */</pre>
    </div>
  </body>
</html>
            